import storage from 'good-storage';
import { domain, domain2 } from 'global/setting';
import { ajaxPost } from 'global/axios';
import tableDropdown from 'public/tableHeaderDropdown';

// 数据一张图-台风路径列表
export function typhoonHistoryTh (that) {
  return [
    {
      width: 60,
      align: 'center',
      render: (h, params) => {
        return h('Checkbox', {
          props: {
            value: params.row.is_current === 1
          },
          on: {
            'on-change': bol => {
              that.choseTyphoon(bol, params);
            }
          }
        });
      }
    },
    {
      title: '编号',
      key: 'tfbh',
      align: 'center'
    },
    {
      title: '中文名',
      key: 'name',
      align: 'center'
    },
    {
      title: '英文名',
      key: 'ename',
      align: 'center'
    }
  ];
}

// 数据一张图-内河涌-基本信息-起点接涌、终点接涌
export const singleWaterNetBase = [
  {
    title: '已采集',
    key: 'beencol',
    width: 80,
    align: 'center',
    render: (h, params) => {
      let str = 'close-round';
      if (params.row.beencol === '1') {
        str = 'checkmark-round';
      }
      return h('Icon', {
        props: {
          type: str
        }
      });
    }
  },
  {
    title: '河涌代码',
    key: 'rivcode',
    width: 90,
    align: 'center'
  },
  {
    title: '河涌名称',
    key: 'rivname'
  },
  {
    title: '河涌类别',
    key: 'rivprop',
    width: 90,
    align: 'center'
  }
];

// 数据一张图-内河涌-桩端信息
export function singleWaterNetPile (that) {
  return [
    {
      title: '操作',
      align: 'center',
      width: 90,
      render: (h, params) => {
        return h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            on: {
              click: () => {
                that._delClick(params.row);
              }
            },
            style: {
              fontSize: '12px'
            }
          },
          '删除'
        );
      }
    },
    {
      title: '桩号段',
      key: 'segcode',
      align: 'center',
      width: 150
    },
    {
      title: '左岸堤顶路情况',
      key: 'lfttop',
      width: 130,
      align: 'center'
    },
    {
      title: '左岸线,岸坡',
      key: 'lftedge',
      width: 150,
      align: 'center'
    },
    {
      title: '左岸堤后地形地貌',
      key: 'lftbake',
      width: 135,
      align: 'center'
    },
    {
      title: '右岸岸堤顶路情况',
      key: 'rghtop',
      width: 135,
      align: 'center'
    },
    {
      title: '右岸线,岸坡',
      key: 'rghedge',
      width: 150,
      align: 'center'
    },
    {
      title: '右岸堤后地形地貌',
      key: 'rghbake',
      width: 135,
      align: 'center'
    },
    {
      title: '河涌底宽(m)',
      key: 'btmwidth',
      width: 110,
      align: 'center'
    },
    {
      title: '河涌断面宽(m)',
      key: 'brokenwidth',
      width: 120,
      align: 'center'
    }
  ];
}

// 数据一张图-内河涌-河涌景观
export function singleWaterNetProfile (that) {
  return [
    {
      title: '操作',
      align: 'center',
      width: 90,
      render: (h, params) => {
        return h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            on: {
              click: () => {
                that._delClick(params.row);
              }
            },
            style: {
              fontSize: '12px'
            }
          },
          '删除'
        );
      }
    },
    {
      title: '景观描述',
      key: 'picname',
      align: 'center'
    }
  ];
}

// 数据一张图-内河涌-河涌巡查信息
export function singleWaterNetPatrol (that) {
  return [
    {
      title: '操作',
      align: 'center',
      width: 90,
      render: (h, params) => {
        return h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            on: {
              click: () => {
                that._delClick(params.row);
              }
            },
            style: {
              fontSize: '12px'
            }
          },
          '删除'
        );
      }
    },
    {
      title: '巡查时间',
      key: 'picname',
      align: 'center',
      width: 120
    },
    {
      title: '巡查员',
      key: 'picname',
      align: 'center',
      width: 80
    },
    {
      title: '巡查描述',
      key: 'picname',
      align: 'center'
    }
  ];
}

// 数据一张图-内河涌-排水口信息
export function singleWaterNetOutfall (that) {
  return [
    {
      title: '操作',
      align: 'center',
      width: 90,
      render: (h, params) => {
        return h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            on: {
              click: () => {
                that._delClick(params.row);
              }
            },
            style: {
              fontSize: '12px'
            }
          },
          '删除'
        );
      }
    },
    {
      title: '地理位置',
      key: 'pntplace',
      width: 250
    },
    {
      title: '排水口编号',
      key: 'pntcode',
      width: 130,
      align: 'center'
    },
    {
      title: '岸别',
      key: 'pntdir',
      width: 120,
      align: 'center'
    },
    {
      title: '取水口尺寸(mm)',
      key: 'trnsieze',
      width: 135,
      align: 'center'
    },
    {
      title: '排水类别',
      key: 'trntype',
      width: 135,
      align: 'center'
    },
    {
      title: '排水来源',
      key: 'trnsource',
      width: 120,
      align: 'center'
    },
    {
      title: '排水口管底高度(m)',
      key: 'trnheight',
      width: 110,
      align: 'center'
    },
    {
      title: '年均排水量(吨)',
      key: 'trntonnage',
      width: 120,
      align: 'center'
    },
    {
      title: '整治情况',
      key: 'trnhandleway',
      width: 135,
      align: 'center'
    },
    {
      title: '整治年份',
      key: 'trnhandleyear',
      width: 135,
      align: 'center'
    },
    {
      title: '建档日期',
      key: 'builddate',
      width: 135,
      align: 'center'
    },
    {
      title: '建档人',
      key: 'buildman',
      width: 135,
      align: 'center'
    },
    {
      title: '采集人',
      key: 'colman',
      width: 135,
      align: 'center'
    },
    {
      title: '采集日期',
      key: 'coldate',
      width: 135,
      align: 'center'
    },
    {
      title: '备注',
      key: 'pntcomment',
      width: 250
    }
  ];
}

// 数据一张图-内河涌-水质情况-取样列表
export function singleWaterNetQuality (that) {
  return [
    {
      title: '操作',
      align: 'center',
      width: 80,
      render: (h, params) => {
        return h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            on: {
              click: e => {
                that._delQualityClick(params.row);
                e.stopPropagation();
                return false;
              }
            },
            style: {
              fontSize: '12px'
            }
          },
          '删除'
        );
      }
    },
    {
      title: '取样时间',
      key: 'pntdate',
      align: 'center'
    }
  ];
}

// 数据一张图-内河涌-水质情况-图例列表
export function singleWaterNetQualityLegend (that) {
  return [
    {
      title: '操作',
      align: 'center',
      width: 130,
      render: (h, params) => {
        if (params.row.waterkey === '取样位置') {
          return h('div', [
            h(
              'Button',
              {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  marginRight: '5px',
                  fontSize: '12px'
                },
                on: {
                  click: () => {
                    that._saveQualityLegend(params.row);
                  }
                }
              },
              '编辑'
            ),
            h(
              'Button',
              {
                props: {
                  type: 'error',
                  size: 'small'
                },
                on: {
                  click: () => {
                    that._delLegendClick(params.index);
                  }
                },
                style: {
                  fontSize: '12px'
                }
              },
              '删除'
            )
          ]);
        } else {
          return h(
            'Button',
            {
              props: {
                type: 'primary',
                size: 'small'
              },
              style: {
                fontSize: '12px'
              },
              on: {
                click: () => {
                  that._saveQualityLegend(params.row);
                }
              }
            },
            '编辑'
          );
        }
      }
    },
    {
      title: '信息项',
      key: 'waterkey',
      align: 'center',
      width: 120
    },
    {
      title: '内容',
      key: 'leftvalue',
      align: 'center',
      width: 90
    },
    {
      title: 'I类标准',
      key: 'I',
      align: 'center',
      width: 90
    },
    {
      title: 'II类标准',
      key: 'II',
      align: 'center',
      width: 90
    },
    {
      title: 'III类标准',
      key: 'III',
      align: 'center',
      width: 90
    },
    {
      title: 'IV类标准',
      key: 'IV',
      align: 'center',
      width: 90
    },
    {
      title: 'V类标准',
      key: 'V',
      align: 'center',
      width: 90
    },
    {
      title: '劣V类标准',
      key: 'lV',
      align: 'center',
      width: 90
    }
  ];
}

// 数据一张图-内河涌-整治方案
export const singleWaterNetRenovation = [
  {
    type: 'selection',
    width: 60,
    align: 'center'
  },
  {
    title: '治理工程分类',
    key: 'handletype',
    align: 'center'
  },
  {
    title: '治理工程名称',
    key: 'handlename',
    align: 'center'
  }
];

// 数据一张图-内河涌-建筑物信息
export function singleWaterNetBuild (that) {
  return [
    {
      title: '所在地(区镇)',
      key: 'town',
      align: 'center',
      width: 120
    },
    {
      title: '所属河道',
      key: 'rivname',
      align: 'center',
      width: 120
    },
    {
      title: '堤防桩号',
      key: 'pilenum',
      align: 'center',
      width: 120
    },
    {
      title: '建筑物名称',
      key: 'building',
      align: 'center',
      width: 120
    },
    {
      title: '面积(㎡)',
      key: 'measure',
      align: 'center',
      width: 120
    },
    {
      title: '层数',
      key: 'floor',
      align: 'center',
      width: 120
    },
    {
      title: '位于',
      key: 'addresss',
      align: 'center',
      width: 120
    },
    {
      title: '建设年份',
      key: 'addresss',
      align: 'center',
      width: 120
    },
    {
      title: '是否历史建筑物',
      key: 'ishistory',
      align: 'center',
      width: 130
    },
    {
      title: '是否办理水利手续',
      key: 'hascert',
      align: 'center',
      width: 140
    },
    {
      title: '采集人',
      key: 'addresss',
      align: 'center',
      width: 120
    },
    {
      title: '入库时间',
      key: 'addresss',
      align: 'center',
      width: 120
    },
    {
      title: '操作',
      key: 'action',
      width: 150,
      align: 'center',
      render: (h, params) => {
        return h('div', [
          h(
            'Button',
            {
              props: {
                type: 'error',
                size: 'small'
              },
              style: {
                fontSize: '12px'
              },
              on: {
                click: () => {
                  that._delClick(params.row);
                }
              }
            },
            '删除'
          )
        ]);
      }
    }
  ];
}

// 数据一张图-内河涌-河长信息
export const singleWaterNetRiver = [
  {
    title: '市级',
    key: 'addresss',
    align: 'center',
    width: 80
  },
  {
    title: '县级',
    key: 'addresss',
    align: 'center',
    width: 80
  },
  {
    title: '镇级',
    key: 'addresss',
    align: 'center',
    width: 80
  },
  {
    title: '村级',
    key: 'addresss',
    align: 'center',
    width: 80
  },
  {
    title: '河流（段）名称',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '岸别（左、右岸）',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '水系',
    key: 'addresss',
    align: 'center',
    width: 80
  },
  {
    title: '总河长职务',
    key: 'addresss',
    align: 'center',
    width: 120
  },
  {
    title: '河长职务',
    key: 'addresss',
    align: 'center',
    width: 120
  },
  {
    title: '负责人姓名',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '河段起止',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '经纬度',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '集雨面积（km2）',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '河段长度（km）',
    key: 'addresss',
    align: 'center',
    width: 150
  },
  {
    title: '备注',
    key: 'addresss',
    align: 'center',
    width: 150
  }
];

// 数据一张图-内河涌-河长工作档案
export const singleWaterNetDocument = [
  {
    title: '建档时间',
    key: 'time',
    align: 'center'
  },
  {
    title: '现场检查情况',
    key: 'time',
    align: 'center'
  },
  {
    title: '现场检查文档',
    key: 'time',
    align: 'center'
  },
  {
    title: '宣传报道',
    key: 'time',
    align: 'center'
  }
];

// 事件页面表格  2020/09/22 新事件处理流程逻辑
export function complaintColumns (that) {
  return [
    {
      title: '时间',
      key: 'report_time',
      width: 150
    },
    {
      title: '地址',
      key: 'address',
      width: 110
    },
    {
      title: '事件来源',
      key: 'user_type',
      width: 120,
      renderHeader: (h, params) => {
        return h(tableDropdown, {
          props: {
            placement: 'bottom-start',
            showArrow: true,
            content: '事件来源',
            data: [
              {
                value: 'all',
                name: '全部'
              },
              {
                value: '1',
                name: '微信投诉'
              },
              {
                value: '2',
                name: '河长巡查'
              },
              {
                value: '3',
                name: '电话信访'
              },
              {
                value: '4',
                name: '公众app'
              },
              {
                value: '5',
                name: '省厅下报'
              }
            ]
          },
          on: {
            'on-choosed': data => {
              if (data !== 'all') {
                that.searchItem.user_type = data;
                that.getComplaint(1, that.type_solve_is);
              } else {
                that.searchItem.user_type = '';
                that.getComplaint(1, that.type_solve_is);
              }
            }
          }
        });
      },
      render: (h, param) => {
        if (param.row.user_type == '1') {
          return h('div', {}, '微信投诉');
        } else if (param.row.user_type == '3') {
          return h('div', {}, '电话信访');
        } else if (param.row.user_type == '4') {
          return h('div', {}, '公众app');
        } else if (param.row.user_type == '2') {
          return h('div', {}, '河长巡查');
        } else if (param.row.user_type == '5') {
          return h('div', {}, '省厅下报');
        }
      }
    },
    {
      title: '河名',
      width: 90,
      key: 'river_name'
    },
    {
      title: '当前流程节点',
      width: 150,
      render: (h, params) => {
        if (params.row.solve_is == '已处理') {
          return h('div', {}, params.row.pro_name);
        } else {
          return h(
            'div',
            {
              style: {
                cursor: 'pointer'
              },
              on: {
                click: () => {
                  that.saveRow = params.row;
                  setTimeout(() => {
                    that.$refs.lc.showModal(params.row);
                  }, 100);
                }
              }
            },
            params.row.pro_name
          );
        }
      }
    },
    {
      title: '处理方式',
      key: 'solve_way',
      width: 120,
      renderHeader: (h, params) => {
        return h(tableDropdown, {
          props: {
            placement: 'bottom-start',
            showArrow: true,
            content: '处理方式',
            data: [
              {
                value: 'all',
                name: '全部'
              },
              {
                value: '自行处理',
                name: '自行处理'
              },
              {
                value: '上报处理',
                name: '上报处理'
              }
            ]
          },
          on: {
            'on-choosed': data => {
              if (data !== 'all') {
                that.searchItem.solve_way = data;
                that.getComplaint(1, that.type_solve_is);
              } else {
                that.searchItem.solve_way = '';
                that.getComplaint(1, that.type_solve_is);
              }
            }
          }
        });
      }
    },
    {
      title: '计划时间',
      key: 'plan_time',
      width: 100
    },
    {
      title: '河长',
      width: 100,
      key: 'chief_realname'
    },
    {
      title: '责任河长办',
      width: 170,
      render: (h, params) => {
        return h('div', {}, params.row.location.dep_name);
      }
    },
    {
      title: '事件上报人',
      width: 120,
      key: 'contacts'
    },
    {
      title: '上报电话',
      width: 100,
      key: 'phone'
    },
    {
      title: '描述',
      key: 'overview',
      width: 200,
      render: (h, param) => {
        let ret = param.row.overview;
        // ret = `${ret.substring(0, 10)}......`;
        // return h('div', {}, ret);
        return h('div', [
          h(
            'Poptip',
            {
              props: {
                trigger: 'hover',
                wordWrap: true,
                width: '300',
                placement: 'bottom',
                zIndex: 888
              }
            },
            [
              h('div', `${ret !== undefined ? ret.substring(0, 10).concat('......') : ''}`),
              h(
                'div',
                {
                  slot: 'content',
                  style: {
                    display: 'flex',
                    maxHeight: '200px'
                  }
                },
                ret
              )
            ]
          )
        ]);
      }
    },
    {
      title: '图片',
      key: 'photos',
      width: 200,
      render: (h, { row }) => {
        if (row.photos && row.photos.length > 0) {
          let html = [];
          for (let i = 0; i < row.photos.length; i++) {
            html.push(
              h('img', {
                attrs: {
                  src: domain2 + row.photos[i]
                },
                style: {
                  width: '50px',
                  height: '50px'
                },
                on: {
                  click: () => {
                    that.$refs.pictures.showImg(row.photos, i);
                  }
                }
              })
            );
          }
          return h('div', html);
        } else {
          return null;
        }
      }
    },
    {
      renderHeader: (h, params) => {
        let user_type = storage.session.get('type');

        let list = [
          h(
            'span',
            {
              style: {
                marginRight: '10px'
              }
            },
            '操作'
          )
        ];

        if (user_type == '4' || user_type == '7' || user_type == '8') {
          list.push(
            h(
              'span',
              {
                style: {
                  display: 'flex',
                  alignItems: 'center',
                  backgroundColor: '#8BC34A',
                  color: 'white',
                  padding: '3px 5px',
                  borderRadius: '5px',
                  cursor: 'pointer'
                },
                on: {
                  click: () => {
                    that.iframeModal = true;
                  }
                }
              },
              [
                h('img', {
                  attrs: {
                    src: '/static/img/message.png'
                  },
                  style: {
                    width: '16px',
                    height: '16px',
                    marginRight: '5px'
                  }
                }),
                h('span', '操作须知')
              ]
            )
          );
        }

        return h(
          'div',
          {
            style: {
              display: 'flex',
              alignItems: 'center'
            }
          },
          list
        );
      },
      key: '',
      width: 430,
      render: (h, param) => {
        let chexiao = h(
          'Button',
          {
            props: {
              type: 'primary',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.saveRow = param.row;
                that.modalDel = true;
              }
            }
          },
          '撤销'
        );
        let weizhi = h(
          'Button',
          {
            props: {
              type: 'primary',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showMap(param.row);
              }
            }
          },
          '查看位置'
        );
        let more = h(
          'Button',
          {
            props: {
              type: 'info',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.print(param.row, '1');
              }
            }
          },
          '详情'
        );
        let morefile = h(
          'Button',
          {
            props: {
              type: 'info',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.print(param.row, '1');
              }
            }
          },
          '详情'
        );
        let shouli = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                // that.cherfModal = true
                // setTimeout(() => {
                //   that.$refs['select'].clearSingleSelect()
                // }, 100)
                // that.username = ''
                // that.complete_opinion2 = ''
                // that.saveRow = param.row
                // that.getTongJiUser(0)
                // that.getXiaSuDep()

                that.saveRow = param.row;
                that.accept();
              }
            }
          },
          '受理'
        );
        let huifu = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.replyModal = true;
                that.reply2 = '';
                that.saveRow = param.row;
              }
            }
          },
          '回复'
        );
        let chuli = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showModal(param.row, '2');
              }
            }
          },
          '直接处理'
        );
        let yijian = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.comfirmModal1 = true;
                that.chref_complete_opinion = '';
                that.username1 = '';
                that.saveRow = param.row;
                that.getTongJiUser(1);
                setTimeout(() => {
                  that.$refs['SHselect'].query = '';
                }, 100);
              }
            }
          },
          '提交处理意见'
        );
        let cjhz = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.cherfModal = true;
                setTimeout(() => {
                  that.$refs['select'].clearSingleSelect();
                }, 100);
                that.username = '';
                that.complete_opinion2 = '';
                that.saveRow = param.row;
                that.getTongJiUser(0);
                that.getXiaSuDep();
              }
            }
          },
          '指派村级河长'
        );
        let back = h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.backModal = true;
                that.saveRow = param.row;
                that.formItem1.reason = '';
              }
            }
          },
          '撤销分派'
        );
        let jieguo = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showModal(param.row, '3');
              }
            }
          },
          '提交处理结果'
        );
        let shenhefenpai = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.shenheAss(param.row);
              }
            }
          },
          '审核分派'
        );
        let duban = h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                let params = {
                  data: {
                    _id: param.row._id
                  },
                  url: '/emergency/report/supervise',
                  token: storage.session.get('token'),
                  success: res => {
                    if (res.data.code == '0000') {
                      that.$Message.success({
                        content: res.data.message
                      });
                    } else {
                      that.$Message.warning({
                        content: res.data.message
                      });
                    }
                  }
                };
                ajaxPost(params);
              }
            }
          },
          '督办'
        );
        let back2 = h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.backModal2 = true;
                that.saveRow = param.row;
                that.formItem1.reason = '';
              }
            }
          },
          '上报上级' //返回河长办
        );
        let tuisong = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.tuisong(param.row);
              }
            }
          },
          '推送到省'
        );

        let xiapai = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.saveRow = param.row;
                that.getXiaSuDep();
                that.assignDownModal = true;
              }
            }
          },
          '下派河长办'
        );

        let danwei = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.saveRow = param.row;
                that.getHostDep();
                that.companyModal = true;
                that.chief_advice = '';
              }
            }
          },
          '指派单位'
        );

        let printPatrol = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small',
            },
            style: {
              marginRight: '5px',
            },
            on: {
              click: () => {
                that.printPatrolModal = true;
                that.printPdf = `${domain}/emergency/patrol/patrolcreate?patrol_no=${param.row.patrol_no}`;
              },
            },
          },
          '打印巡河记录表'
        );

        let level = storage.session.get('level'); //level为1是市级的，2为区级，3为镇级
        let user_type = storage.session.get('type');
        let user_dep = storage.session.get('dep_name');
        let isWork = storage.session.get('isWork'); // 是否河长界面

        // 2020/12/22启用
        if (param.row.solve_is === '处理中') {
          if (user_dep !== param.row.location.dep_name) {
            return h('div', [more, weizhi, printPatrol]);
          }
          if (level == '1') {
            //市级

            if (isWork) { // 河长界面，只显示详情、位置按钮，无权处理事件
              return h('div', [more, weizhi, printPatrol]);
            } else {
              // 市级河长、市级河长助理与市级河长办一样，有处理按钮 2021/04/21
              if (user_type === '4' || user_type === '7' || user_type === '3' || user_type === '9') {
                //市级河长办、负责人、经办人
                if (
                  param.row.complete_time === undefined ||
                  param.row.complete_time === null ||
                  param.row.complete_time === '' &&
                  param.row.pro_num !== 'C0'
                ) {
                  return h('div', [xiapai, shouli, more, chexiao, weizhi, printPatrol]);
                } else {
                  return h('div', [jieguo, more, chexiao, weizhi, printPatrol]);
                }
              }
              if (user_type === '8') {
                if (
                  param.row.complete_time === undefined ||
                  param.row.complete_time === null ||
                  param.row.complete_time === '' &&
                  param.row.pro_num !== 'C0'
                ) {
                  return h('div', [xiapai, shouli, more, weizhi]);
                } else {
                  return h('div', [shouli, jieguo, more, weizhi]);
                }
              }
              if (user_type === '5' || user_type === '6') {
                //市级职能人员、助理
                return h('div', [more, weizhi, printPatrol]);
              }
            }
          } else if (level == '2') {
            //区级
            if (user_type === '2') {
              //区级河长
              return h('div', [more, weizhi, printPatrol]);
            }
            if (user_type === '4' || user_type === '7') {
              //区级河长办、负责人、经办人
              if (param.row.pro_name.indexOf('区河长') < 0) {
                return h('div', [jieguo, more, weizhi, printPatrol]);
              } else if (
                param.row.complete_time === undefined ||
                param.row.complete_time === null ||
                param.row.complete_time === '' &&
                param.row.pro_num !== 'A0' &&
                param.row.pro_num !== 'C0'
              ) {
                return h('div', [back2, xiapai, shouli, more, chexiao, weizhi, printPatrol]);
              } else if (
                param.row.complete_time === undefined ||
                param.row.complete_time === null ||
                param.row.complete_time === '' &&
                param.row.pro_num !== 'C0'
              ) {
                return h('div', [xiapai, shouli, more, chexiao, weizhi, printPatrol]);
              } else if (
                param.row.complete_time === undefined ||
                param.row.complete_time === null ||
                param.row.complete_time === '' &&
                param.row.pro_num !== 'A0'
              ) {
                return h('div', [back2, shouli, more, chexiao, weizhi, printPatrol]);
              } else {
                return h('div', [jieguo, more, chexiao, weizhi, printPatrol]);
              }
            }
            if (user_type === '8') {
              if (
                param.row.complete_time === undefined ||
                param.row.complete_time === null ||
                param.row.complete_time === '' &&
                param.row.pro_num !== 'A0' &&
                param.row.pro_num !== 'C0'
              ) {
                return h('div', [back2, xiapai, shouli, more, weizhi, printPatrol]);
              } else {
                return h('div', [shouli, jieguo, more, weizhi, printPatrol]);
              }
            }
            if (user_type === '5' || user_type === '6' || user_type === '9') {
              //区级职能人员、助理
              return h('div', [more, weizhi, printPatrol]);
            }
          } else {
            //镇级
            if (user_type === '1') {
              //镇级河长
              return h('div', [more, weizhi]);
            } else if (user_type === '4' || user_type === '7') {
              //镇级河长办、负责人、经办人
              if (
                param.row.complete_time === undefined ||
                param.row.complete_time === null ||
                param.row.complete_time === '' &&
                param.row.pro_num !== 'A0'
              ) {
                return h('div', [back2, shouli, more, chexiao, weizhi]);
              } else {
                return h('div', [jieguo, more, chexiao, weizhi]);
              }
            } else if (user_type === '8') {
              if (
                param.row.complete_time === undefined ||
                param.row.complete_time === null ||
                param.row.complete_time === '' &&
                param.row.pro_num !== 'A0'
              ) {
                return h('div', [back2, shouli, more, weizhi]);
              } else {
                return h('div', [jieguo, more, weizhi]);
              }
            } else if (
              user_type === '5' ||
              user_type === '6' ||
              user_type === '9'
            ) {
              //镇级职能人员、助理
              return h('div', [more, weizhi]);
            }

            if (user_type === '0') {
              //村级河长
              return h('div', [more, weizhi]);
            }
          }
        } else {
          return h('div', [more, weizhi, printPatrol]);
        }
      }
    }
  ];
}

// 事件页面表格   2020/09/22 事件旧逻辑处理流程，废弃使用
// export function complaintColumns(that) {
//   return [
//     {
//       title: '时间',
//       key: 'report_time',
//       width: 150
//     },
//     {
//       title: '地址',
//       key: 'address',
//       width: 110
//     },
//     {
//       title: '事件来源',
//       key: 'user_type',
//       width: 120,
//       renderHeader: (h, params) => {
//         return h(tableDropdown, {
//           props: {
//             placement: 'bottom-start',
//             showArrow: true,
//             content: '事件来源',
//             data: [{
//               value: 'all',
//               name: '全部'
//             }, {
//               value: '1',
//               name: '微信投诉'
//             }, {
//               value: '2',
//               name: '河长巡查'
//             }, {
//               value: '3',
//               name: '电话信访'
//             }, {
//               value: '4',
//               name: '公众app'
//             }, {
//               value: '5',
//               name: '省厅下报'
//             }]
//           },
//           on: {
//             'on-choosed': (data) => {
//               if (data !== 'all') {
//                 that.searchItem.user_type = data
//                 that.getComplaint(1, that.type_solve_is)
//               } else {
//                 that.searchItem.user_type = ''
//                 that.getComplaint(1, that.type_solve_is)
//               }
//             }
//           }
//         })
//       },
//       render: (h, param) => {
//         if (param.row.user_type == '1') {
//           return h('div', {}, '微信投诉')
//         } else if (param.row.user_type == '3') {
//           return h('div', {}, '电话信访')
//         } else if (param.row.user_type == '4') {
//           return h('div', {}, '公众app')
//         } else if (param.row.user_type == '2') {
//           return h('div', {}, '河长巡查')
//         } else if (param.row.user_type == '5') {
//           return h('div', {}, '省厅下报')
//         }
//       }
//     },
//     {
//       title: '河名',
//       width: 90,
//       key: 'river_name'
//     },
//     {
//       title: '状态',
//       width: 150,
//       render: (h, params) => {
//         if (params.row.solve_is == '已处理') {
//           return h('div', {}, params.row.pro_name)
//         } else {
//           return h(
//             'div',
//             {
//               style: {
//                 cursor: 'pointer'
//               },
//               on: {
//                 click: () => {
//                   that.saveRow = params.row
//                   setTimeout(() => { that.$refs.lc.showModal(params.row) }, 100)
//                 }
//               }
//             },
//             params.row.pro_name
//           )
//         }
//       }
//     },
//     {
//       title: '计划时间',
//       key: 'plan_time',
//       width: 100
//     },
//     {
//       title: '负责河长',
//       width: 100,
//       render: (h, param) => {
//         return h('div', {}, param.row.respon_chief.realname)
//       }
//     },
//     {
//       title: '责任河长办',
//       width: 170,
//       render: (h, params) => {
//         return h('div', {}, params.row.location.dep_name)
//       }
//     },
//     {
//       title: '事件上报人',
//       width: 120,
//       key: 'contacts'
//     },
//     {
//       title: '上报电话',
//       width: 100,
//       key: 'phone'
//     },
//     {
//       title: '描述',
//       key: 'overview',
//       width: 90,
//       render: (h, param) => {
//         let ret = param.row.overview
//         ret = `${ret.substring(0, 10)}......`
//         return h('div', {}, ret)
//       }
//     },
//     {
//       title: '图片',
//       key: 'photos',
//       width: 200,
//       render: (h, param) => {
//         if (param.row.photos.length > 0) {
//           let html = []
//           for (let i = 0; i < param.row.photos.length; i++) {
//             html.push(
//               h('img', {
//                 attrs: {
//                   src: domain2 + param.row.photos[i]
//                 },
//                 style: {
//                   width: '50px',
//                   height: '50px'
//                 },
//                 on: {
//                   click: () => {
//                     that.$refs.pictures.showImg(param.row.photos, i)
//                   }
//                 }
//               })
//             )
//           }
//           return h('div', html)
//         } else {
//           return null
//         }
//       }
//     },
//     {
//       renderHeader: (h, params) => {
//         return h('div', {
//           style: {
//             display: 'flex',
//             alignItems: 'center'
//           }
//         }, [
//           h('span',
//             {
//               style: {
//                 marginRight: '10px'
//               }
//             },
//             '操作'),
//           h('span', {
//             style: {
//               display: 'flex',
//               alignItems: 'center',
//               backgroundColor: '#8BC34A',
//               color: 'white',
//               padding: '3px 5px',
//               borderRadius: '5px'
//             },
//             on: {
//               click: () => {
//                 that.iframeModal = true
//               }
//             }
//           }, [
//             h('img', {
//               attrs: {
//                 src: 'static/img/message.png'
//               },
//               style: {
//                 width: '16px',
//                 height: '16px',
//                 marginRight: '5px'
//               }
//             }),
//             h('span', '操作须知')
//           ])
//         ])
//       },
//       key: '',
//       width: 430,
//       render: (h, param) => {
//         let chexiao = h(
//           'Button',
//           {
//             props: {
//               type: 'primary',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.cancel(param.row)
//               }
//             }
//           },
//           '撤销'
//         )
//         let weizhi = h(
//           'Button',
//           {
//             props: {
//               type: 'primary',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.showMap(param.row)
//               }
//             }
//           },
//           '查看位置'
//         )
//         let more = h(
//           'Button',
//           {
//             props: {
//               type: 'info',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.print(param.row, '1')
//               }
//             }
//           },
//           '详情'
//         )
//         let morefile = h(
//           'Button',
//           {
//             props: {
//               type: 'info',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.print(param.row, '1')
//               }
//             }
//           },
//           '详情'
//         )
//         let shouli = h(
//           'Button',
//           {
//             props: {
//               type: 'success',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.cherfModal = true
//                 setTimeout(() => {
//                   that.$refs['select'].clearSingleSelect()
//                 }, 100)
//                 that.username = ''
//                 that.complete_opinion2 = ''
//                 that.saveRow = param.row
//                 that.getTongJiUser(0)
//                 that.getXiaSuDep()
//               }
//             }
//           },
//           '受理'
//         )
//         let huifu = h(
//           'Button',
//           {
//             props: {
//               type: 'success',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.replyModal = true
//                 that.reply2 = ''
//                 that.saveRow = param.row
//               }
//             }
//           },
//           '回复'
//         )
//         let chuli = h(
//           'Button',
//           {
//             props: {
//               type: 'warning',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.showModal(param.row, '2')
//               }
//             }
//           },
//           '直接处理'
//         )
//         let yijian = h(
//           'Button',
//           {
//             props: {
//               type: 'warning',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.comfirmModal1 = true
//                 that.chref_complete_opinion = ''
//                 that.username1 = ''
//                 that.saveRow = param.row
//                 that.getTongJiUser(1)
//                 setTimeout(() => {
//                   that.$refs['SHselect'].query = ''
//                 }, 100)
//               }
//             }
//           },
//           '提交处理意见'
//         )
//         let cjhz = h(
//           'Button',
//           {
//             props: {
//               type: 'success',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.cherfModal = true
//                 setTimeout(() => {
//                   that.$refs['select'].clearSingleSelect()
//                 }, 100)
//                 that.username = ''
//                 that.complete_opinion2 = ''
//                 that.saveRow = param.row
//                 that.getTongJiUser(0)
//                 that.getXiaSuDep()
//               }
//             }
//           },
//           '指派村级河长'
//         )
//         let back = h(
//           'Button',
//           {
//             props: {
//               type: 'error',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.backModal = true
//                 that.saveRow = param.row
//                 that.formItem1.reason = ''
//               }
//             }
//           },
//           '撤销分派'
//         )
//         let jieguo = h(
//           'Button',
//           {
//             props: {
//               type: 'warning',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.showModal(param.row, '3')
//               }
//             }
//           },
//           '提交处理结果'
//         )
//         let shenhefenpai = h(
//           'Button',
//           {
//             props: {
//               type: 'warning',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.shenheAss(param.row)
//               }
//             }
//           },
//           '审核分派'
//         )
//         let duban = h(
//           'Button',
//           {
//             props: {
//               type: 'error',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 let params = {
//                   data: {
//                     _id: param.row._id
//                   },
//                   url: '/emergency/report/supervise',
//                   token: storage.session.get('token'),
//                   success: res => {
//                     if (res.data.code == '0000') {
//                       that.$Message.success({
//                         content: res.data.message
//                       })
//                     } else {
//                       that.$Message.warning({
//                         content: res.data.message
//                       })
//                     }
//                   }
//                 }
//                 ajaxPost(params)
//               }
//             }
//           },
//           '督办'
//         )
//         let back2 = h(
//           'Button',
//           {
//             props: {
//               type: 'error',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.backModal2 = true
//                 that.saveRow = param.row
//                 that.formItem1.reason = ''
//               }
//             }
//           },
//           '返回河长办'
//         )
//         let tuisong = h(
//           'Button',
//           {
//             props: {
//               type: 'warning',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.tuisong(param.row)
//               }
//             }
//           },
//           '推送到省'
//         )
//         let danwei = h(
//           'Button',
//           {
//             props: {
//               type: 'success',
//               size: 'small'
//             },
//             style: {
//               marginRight: '5px'
//             },
//             on: {
//               click: () => {
//                 that.saveRow = param.row
//                 that.getHostDep()
//                 that.companyModal = true
//                 that.chief_advice = ''
//               }
//             }
//           },
//           '指派单位'
//         )
//         let level = storage.session.get('level')  //level为1是市级的，2为区级，3为镇级
//         let user_type = storage.session.get('type')

//         if (user_type === '8') {
//           return h('div', {}, '')
//         }
//         if (param.row.solve_is === '处理中') {
//           if (
//             param.row.pro_num == 'A5' ||
//             param.row.pro_num == 'B5' ||
//             param.row.pro_num == 'C4' ||
//             param.row.pro_num == 'V2'
//           ) {
//             if (user_type === '7') {
//               return h('div', [weizhi, duban, more])
//             } else {
//               return h('div', [weizhi, huifu, more])
//             }
//           } else if (level == '1') {
//             if (param.row.pro_num == 'A0' && user_type === '4') {
//               return h('div', [tuisong, weizhi, shouli, chuli, danwei, more])
//             } else if (param.row.pro_num == 'AM0' && user_type === '7') {
//               return h('div', [weizhi, shenhefenpai, more])
//             } else if (param.row.pro_num == 'AM0' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else if (param.row.pro_num == 'A1' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else {
//               return h('div', [weizhi, duban, more])
//             }
//           } else if (level == '2') {
//             if (param.row.pro_num == 'B0' && user_type === '4') {
//               return h('div', [weizhi, back2, chuli, shouli, danwei, more])
//             } else if (param.row.pro_num == 'BM0' && user_type === '7') {
//               return h('div', [weizhi, shenhefenpai, more])
//             } else if (param.row.pro_num == 'BM0' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else if (param.row.pro_num == 'B1' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else {
//               return h('div', [weizhi, duban, more, chexiao])
//             }
//           } else if (level == '3') {
//             if (param.row.pro_num == 'C0' && user_type === '4') {
//               return h('div', [weizhi, yijian, back2, chuli, shouli, more])
//             } else if (param.row.pro_num == 'C2' && user_type === '4') {
//               return h('div', [weizhi, jieguo, back2, more])
//             } else if (param.row.pro_num == 'CM0' && user_type === '7') {
//               return h('div', [weizhi, shenhefenpai, more])
//             } else if (param.row.pro_num == 'CM0' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else if (param.row.pro_num == 'C1' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else if (param.row.pro_num == 'V0' && user_type === '4') {
//               return h('div', [weizhi, back, more])
//             } else {
//               return h('div', [weizhi, duban, more])
//             }
//           }
//         } else {
//           return h('div', [weizhi, morefile])
//         }
//       }
//     }
//   ]
// }

// 河长事件页面表格
export function chiefComplaintColumns (that) {
  return [
    {
      title: '事件来源',
      width: 120,
      key: 'user_type',
      renderHeader: (h, params) => {
        return h(tableDropdown, {
          props: {
            placement: 'bottom-start',
            showArrow: true,
            content: '事件来源',
            data: [
              {
                value: 'all',
                name: '全部'
              },
              {
                value: '1',
                name: '微信投诉'
              },
              {
                value: '2',
                name: '河长巡查'
              },
              {
                value: '3',
                name: '电话信访'
              },
              {
                value: '4',
                name: '公众app'
              },
              {
                value: '5',
                name: '省厅下报'
              }
            ]
          },
          on: {
            'on-choosed': data => {
              if (data !== 'all') {
                that.searchItem.user_type = data;
                that.getComplaint(1, that.type_solve_is);
              } else {
                that.searchItem.user_type = '';
                that.getComplaint(1, that.type_solve_is);
              }
            }
          }
        });
      },
      render: (h, param) => {
        if (param.row.user_type == '1') {
          return h('div', {}, '微信投诉');
        } else if (param.row.user_type == '3') {
          return h('div', {}, '电话信访');
        } else if (param.row.user_type == '4') {
          return h('div', {}, '公众app');
        } else if (param.row.user_type == '2') {
          return h('div', {}, '河长巡查');
        } else if (param.row.user_type == '5') {
          return h('div', {}, '省厅下报');
        }
      }
    },
    {
      title: '状态',
      width: 90,
      render: (h, params) => {
        if (params.row.solve_is == '已处理') {
          return h('div', {}, params.row.pro_name);
        } else {
          return h(
            'div',
            {
              style: {
                cursor: 'pointer'
              },
              on: {
                click: () => {
                  that.saveRow = params.row;
                  that.$refs.lc.showModal(params.row);
                }
              }
            },
            params.row.pro_name
          );
        }
      }
    },
    {
      title: '河名',
      width: 150,
      key: 'river_name'
    },
    {
      title: '时间',
      key: 'report_time',
      width: 100
    },
    {
      title: '计划时间',
      key: 'plan_time',
      width: 120
    },
    {
      title: '负责河长',
      width: 120,
      render: (h, param) => {
        return h('div', {}, param.row.respon_chief.realname);
      }
    },
    {
      title: '责任河长办',
      width: 120,
      render: (h, params) => {
        return h('div', {}, params.row.location.dep_name);
      }
    },
    {
      title: '联系人',
      width: 120,
      key: 'contacts'
    },
    {
      title: '电话',
      width: 120,
      key: 'phone'
    },
    {
      title: '描述',
      width: 120,
      key: 'overview',
      render: (h, param) => {
        let ret = param.row.overview;
        ret = `${ret.substring(0, 10)}......`;
        return h('div', {}, ret);
      }
    },
    {
      title: '图片',
      key: 'photos',
      width: 200,
      render: (h, param) => {
        if (param.row.photos.length > 0) {
          let html = [];
          for (let i = 0; i < param.row.photos.length; i++) {
            html.push(
              h('img', {
                attrs: {
                  src: domain2 + param.row.photos[i]
                },
                style: {
                  width: '50px',
                  height: '50px'
                },
                on: {
                  click: () => {
                    that.$refs.pictures.showImg(param.row.photos, i);
                  }
                }
              })
            );
          }
          return h('div', html);
        } else {
          return null;
        }
      }
    },
    {
      title: '操作',
      key: '',
      width: 350,
      render: (h, param) => {
        let type = storage.session.get('type');
        let weizhi = h(
          'Button',
          {
            props: {
              type: 'primary',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showMap(param.row);
              }
            }
          },
          '查看位置'
        );
        let yijian = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.chref_complete_opinion = param.row.complete_opinion;
                that.comfirmModal1 = true;
                that.reason = '';
                that.saveRow = param.row;
              }
            }
          },
          '意见审核'
        );
        let more = h(
          'Button',
          {
            props: {
              type: 'info',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.print(param.row, '1');
              }
            }
          },
          '详情'
        );
        let morefile = h(
          'Button',
          {
            props: {
              type: 'info',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.print(param.row, '1');
              }
            }
          },
          '详情'
        );
        let jieguo = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showModal(param.row, '4');
                that.saveRow = param.row;
                that.reason = '';
              }
            }
          },
          '审核处理结果'
        );
        let danwei = h(
          'Button',
          {
            props: {
              type: 'success',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.companyModal = true;
                that.saveRow = param.row;
                that.chief_advice = '';
              }
            }
          },
          '指派单位'
        );
        let chuli = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showModal(param.row, '2');
              }
            }
          },
          '确认处理'
        );
        let tijiao = h(
          'Button',
          {
            props: {
              type: 'warning',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.showModal(param.row, '2');
              }
            }
          },
          '提交处理结果'
        );
        let back = h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.backModal = true;
                that.saveRow = param.row;
                that.formItem1.reason = '';
              }
            }
          },
          '返回河长办'
        );
        let ziji = h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                that.myModal = true;
                that.saveRow = param.row;
              }
            }
          },
          '自己主办'
        );
        let duban = h(
          'Button',
          {
            props: {
              type: 'error',
              size: 'small'
            },
            style: {
              marginRight: '5px'
            },
            on: {
              click: () => {
                let params = {
                  data: {
                    _id: param.row._id
                  },
                  url: '/emergency/report/supervise',
                  token: storage.session.get('token'),
                  success: res => {
                    if (res.data.code == '0000') {
                      that.$Message.success({
                        content: res.data.message
                      });
                    } else {
                      that.$Message.warning({
                        content: res.data.message
                      });
                    }
                  }
                };
                that.ajaxPost(params);
              }
            }
          },
          '督办'
        );
        //pro_num 流程节点代号
        if (param.row.solve_is === '处理中') {
          if (type == '0') {
            if (param.row.pro_num == 'V0') {
              return h('div', [weizhi, yijian, more]);
            } else if (param.row.pro_num == 'V1') {
              return h('div', [weizhi, chuli, more]);
            } else {
              return h('div', [weizhi, duban, more]);
            }
          } else if (type == '1') {
            if (param.row.pro_num == 'C1') {
              return h('div', [weizhi, yijian, more]);
            } else if (param.row.pro_num == 'C3') {
              return h('div', [weizhi, jieguo, more]);
            } else {
              return h('div', [weizhi, duban, more]);
            }
          } else if (type == '2' || type == '3') {
            if (param.row.pro_num == 'B1' || param.row.pro_num == 'A1') {
              return h('div', [weizhi, danwei, ziji, more]);
            } else if (param.row.pro_num == 'B3' || param.row.pro_num == 'A3') {
              return h('div', [weizhi, jieguo, more]);
            } else if (param.row.pro_num == 'B4' || param.row.pro_num == 'A4') {
              return h('div', [weizhi, chuli, more]);
            } else {
              return h('div', [weizhi, duban, more]);
            }
          }
        } else {
          return h('div', [weizhi, morefile]);
        }
      }
    }
  ];
}
